package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-08-29 14:23
 */
public class Test02 {
    public static void main(String[] args) {
        int[] array = {1, 3, 45, 12, 5, 0, 0, 0};
        for(int i=0;i<array.length;i++){
            System.out.print(array[i]+"\t");
        }
        System.out.println();
        int beginIndex = 1,endIndex = 5;
        int num=55;
        for(int i=endIndex; i>=beginIndex+1; i--){
            array[i]=array[i-1];
//            System.out.println("i="+i+",i-1="+(i-1));
//            System.out.println(i);
        }



        //顺序遍历
        for(int i=0;i<array.length;i++){
            System.out.print(array[i]+"\t");
        }
        System.out.println();
        //逆序遍历
//        for(int i=array.length-1;i>=0;i--){
//            System.out.println(array[i]);
//        }


    }
}
